//
//  JDConfig.swift
//  DragonWallet
//
//  Created by volantPig on 2024/2/20.
//

import UIKit

class JDConfig: NSObject {

}

func color(_ hexString: String) -> UIColor {
    return UIColor.init(hexString: hexString)
}

func cgColor(_ hexString: String) -> CGColor {
    return UIColor.init(hexString: hexString).cgColor
}

/// 系统默认正常字体文字
func systemFont(_ fontSize: CGFloat) -> UIFont {
    return UIFont.systemFont(ofSize: fontSize * fitWidth)
}

/// 系统默认粗体文字
func boldFont(_ fontSize: CGFloat) -> UIFont {
    return UIFont.boldSystemFont(ofSize: fontSize * fitWidth)
}

let screenWidth = (UIScreen.main.bounds.size.width)
let screenHeight = (UIScreen.main.bounds.size.height)
let statusBarHeight = (UIApplication.shared.statusBarFrame.size.height)

let fitWidth = CGFloat(screenWidth/375.0)
let fitHeight = CGFloat(screenHeight/667.0)

// 当前设备是 iPad
let iPad = Bool(UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad)

// 当前设备是 iPhone
let iPhone = Bool(UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.phone)

// 获取 当前 设备 iOS 版本
let iOS_VERSION = UIDevice.current.systemVersion

// 获取 当前 App 版本
let APP_VERSION = Bundle.main.infoDictionary?["CFBundleShortVersionString"]

let userUUID = UIDevice.current.identifierForVendor?.uuidString //UUID().uuidString

let UIScreenWidth = UIScreen.main.bounds.width
let UIScreenHeight = UIScreen.main.bounds.height
let SafeAreaBottomInset = UIApplication.shared.delegate?.window??.safeAreaInsets.bottom ?? UIEdgeInsets.zero.bottom
let SafeAreaInset = UIApplication.shared.delegate?.window??.safeAreaInsets ?? UIEdgeInsets.zero

/// 底部34的安全区域 --- --- ---  可用
let bottomSaftAreaHeight = UIApplication.shared.windows.first?.safeAreaInsets.bottom ?? 0
let topSaftAreaHeight = UIApplication.shared.windows.first?.safeAreaInsets.top ?? 0
